package service.administrator;

import java.util.List;
import dao.AdministratorDAO;
import dao.RecordDuplicateException;
import entities.Administrator;


public class AdministratorServiceInMemory implements AdministratorService {

	public AdministratorServiceInMemory(){
		
	}
	
	public static AdministratorService newInstance(){
		return new AdministratorServiceInMemory();
	}
	
	/**
	 * Finds a customer based on the customer id.
	 * @param userid - user id
	 * @return the instance of the customer
	 */
	public Administrator findAdministrator(String username){
		AdministratorDAO db = AdministratorDAO.getInstance();
		Administrator result = null;
		result = db.findAdministrator(username);
		return result;
	}
	
	
	/**
	 * Adds a new customer to the system.
	 * @param obj - the customer instance to add
	 */
	
	public void addAdministrator(Administrator obj) throws RecordDuplicateException{
		AdministratorDAO db = AdministratorDAO.getInstance();	
		db.addAdministrator(obj);
		return;
	}

	public List<Administrator> administratorList() {
		AdministratorDAO db = AdministratorDAO.getInstance();
		return db.getListAdministrators();
	}

	public void removeAdministrator(Administrator obj) {
		// TODO Auto-generated method stub
		
	}

	public void setAdministrator(Administrator obj) {
		// TODO Auto-generated method stub
		
	}

}
